<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <jsp:include page="/inc/head.jsp"/>
    <title>教师更新</title>
</head>
<body>
<jsp:include page="/inc/top.jsp"/>
<div class="container">
    <jsp:include page="inc.jsp"/>
    <h3 style="text-align: center">教师更新</h3>
    <hr>
    <form action="<%=request.getContextPath()%>/admin/teacher?m=updateAction" method="post" class="form-horizontal">
        <input type="hidden" name="id" value="${teacher.id}"/>
        <div class="form-group">
            <label class="col-sm-2 control-label">教师名称:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="name" value="${teacher.name}" placeholder="输入教师姓名">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">教师编号:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" readonly name="tno" placeholder="输入教师编号">
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">所在部门:</label>
            <div class="col-sm-6">
                <select class="form-control" name="depId">
                    <c:forEach var="dep" items="${deps}">
                        <c:if test="${dep.id==teacher.dep.id}">
                            <option value="${dep.id}" selected>${dep.name}</option>
                        </c:if>
                        <c:if test="${dep.id!=teacher.dep.id}">
                            <option value="${dep.id}">${dep.name}</option>
                        </c:if>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">手机:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="mobile" value="${teacher.mobile}" placeholder="输入手机">
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">薪水:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="salary" value="${teacher.salary}" placeholder="输入薪水">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">更新教师</button>
                <button type="reset" class="btn btn-default">重置信息</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>
